<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <link rel="stylesheet" href="/statics/layui/font/font.css" media="all"/>
    <style type="text/css">
        .layui-footer {
            padding: 10px 0;
            text-align: center;
            box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
        }

        .layui-container {
            padding-top: 20px;
            width: auto;;
        }
        /*单元格备注样式*/
        .layui-table td.tdBz {
            text-align: left;
            padding-left: 0;
            border-left: none;
            color: #aaa;
        }

        .padNone .layui-form-select .layui-input {
            padding-right: 0;
        }
    </style>
</head>
<body>
<div class="layui-container">
    <form id="form" class="layui-form layui-form-pane" action="" lay-filter="example">
        <input type="hidden" name="buildCorpId" class="formData" value="">
        <input type="hidden" name="prjId" class="formData" value="">
        <!--建设单位信息-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">个人信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="layui-hide">
                            <td width="24%">
                                <input name="userId" type="text"
                                       class="layui-input layui-disabled" disabled autocomplete="off"
                                       placeholder="人员Id">
                            </td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8 required">身份证号码：</td>
                            <td colspan="2">
                                <input name="userCard" type="text"
                                       class="layui-input layui-disabled" disabled autocomplete="off"
                                       placeholder="身份证号码">
                            </td>
                            <td class="th8 required">民族：</td>
                            <td colspan="2">
                                <select name="nation" id="nation" class="layui-disabled" disabled>
                                    <option value="">请选择</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">手机号码：</td>
                            <td colspan="2">
                                <input name="contact" type="text"
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="手机号码">
                            </td>
                            <td class="th8 required">常用邮箱：</td>
                            <td colspan="2">
                                <input name="email" type="text"
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="常用邮箱">
                            </td>

                        </tr>
                        <tr>
                            <td class="th8 required">性别：</td>
                            <td colspan="2">
                                <select name="gender" id="gender" class="layui-disabled" disabled>
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td class="th8 required">出生日期：</td>
                            <td colspan="2">
                                <input name="birthDate" type="text"
                                       class="layui-input formData layui-disabled" disabled autocomplete="off"
                                       placeholder="出生日期">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">目前所在企业：</td>
                            <td colspan="2">
                                <input name="orgNameList" type="text"
                                       class="layui-input formData layui-disabled" disabled autocomplete="off"
                                       placeholder="项目负责人">
                            </td>
                            <td class="th8 required">从事岗位（职务）：</td>
                            <td colspan="2">
                                <input name="sealList"type="text"
                                       class="layui-input formData layui-disabled" disabled autocomplete="off"
                                       placeholder="从事岗位（职务）">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!--附件-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">附件</h2>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-footer">
                    <button class="layui-btn demo1" lay-submit lay-filter="submit" id="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </div>
    </form>

</div>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    layui.use(['form', 'sessionFun', 'configure', 'configureCom', 'laydate'], function () {
        window.$ = layui.$;
        var form = layui.form;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var laydate = layui.laydate;
        var sessionFun = layui.sessionFun;
        configureCom.postDataAjax(configure.SYS_USER_INFO_USERID_HTTP,{}).then(function (res) {
            var data = res.user;
            form.val('example',data);
            configureCom.selectDataFun(configure.SEX, data.gender, '#gender');//性别
            configureCom.selectDataFun(configure.NATION_CODE, data.nation, '#nation');//民族
        });

        //监听提交
        form.on('submit(submit)', function(data){
            var  nextAll ={
                contact :data.field.contact,
                email :data.field.email,
                userId :data.field.userId

            };
            configureCom.postDataAjax(configure.USERINFO_UPDATE_HTTP,nextAll).then(function (res) {
                top.layer.msg('修改成功');
                configureCom.tableReload();
            });
            return false;
        });


    });

    function getData() {
        var data = {};
        $('.formData').each(function (index, item) {
            var key = $(item).attr('name');
            data[key] = $(item).val();
        });
        return data;
    }
</script>
</body>
</html>
